package org.zsl.ioc.app.spring.app;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.zsl.ioc.app.spring.model.User;

public class Client3 {

    public static void main(String[] args) {

        ApplicationContext context =
                 new ClassPathXmlApplicationContext("classpath:spring3.xml");


//        User user1  = (User) context.getBean("user1");
//
//        System.out.println(user1.getRole().getRoleName());


         User user2 = (User) context.getBean("user2");

         System.out.println(user2.getRole().getRoleName());
    }
}
